﻿<UserControl x:Class="QuanLyKho.ucThongKeTienNo"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:Core="http://schemas.devexpress.com/winfx/2008/xaml/core"
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
        xmlns:common="clr-namespace:QuanLyKho.CommonControl"
        xmlns:my="clr-namespace:QuanLyKho.CommonControl"
        xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/printing">
    <UserControl.Resources>
        <Style TargetType="Label">
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
        <Style TargetType="dxe:DateEdit">
            <Setter Property="Margin" Value="2,2" />
        </Style>
        <Style TargetType="dxe:ComboBoxEdit">
            <Setter Property="Margin" Value="1,1" />
        </Style>
        <Style TargetType="Button">
            <Setter Property="Margin" Value="3,3" />
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="120"></RowDefinition>
                <RowDefinition Height="5"></RowDefinition>
                <RowDefinition Height="100*"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <GroupBox Header="Thông tin thống kê">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="28"></RowDefinition>
                        <RowDefinition Height="28"></RowDefinition>
                        <RowDefinition Height="28"></RowDefinition>
                        <!--<RowDefinition Height="10"></RowDefinition>
                        <RowDefinition Height="30"></RowDefinition>-->
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="360"></ColumnDefinition>
                        <ColumnDefinition Width="10"></ColumnDefinition>
                        <ColumnDefinition Width="90"></ColumnDefinition>
                        <ColumnDefinition Width="180"></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <my:CalendarControl x:Name="calendar" Grid.RowSpan="4"></my:CalendarControl>
                    <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Column="2" Grid.Row="1" Height="32" Grid.RowSpan="2">
                        <Button Content="Thống kê" Name="btnThongKe" Width="80" Click="btnThongKe_Click" />
                        <!--<Button Content="In phiếu" Name="btnInPhieu" Width="80" Click="btnInPhieu_Click" IsEnabled="False"/>-->
                        <Button Content="Đóng" Name="btnDong" Width="80" Click="btnDong_Click" />
                    </StackPanel>
                    <Label Content="Thống kê tiền:" Grid.Column="2" Grid.Row="0"/>
                    <dxe:ComboBoxEdit Grid.Column="3" Grid.Row="0" Name="cboTienNo" 
                                      SelectedIndex="0" Margin="2,2" IsTextEditable="False">
                        <dxe:ComboBoxEditItem>Đang nợ</dxe:ComboBoxEditItem>
                        <dxe:ComboBoxEditItem>Đã trả</dxe:ComboBoxEditItem>
                    </dxe:ComboBoxEdit>
                </Grid>
            </GroupBox>
            <dxg:GridControl Grid.Row="2" Name="gridThongKe">
                <dxg:GridControl.Columns>
                    <dxg:GridColumn Header="Nhà phân phối" FieldName="TenNhaPhanPhoi" AllowEditing="False" Width="100"/>
                    <dxg:GridColumn Header="Số tiền" FieldName="SoTien" AllowEditing="False" Width="80">
                        <dxg:GridColumn.EditSettings>
                            <dxe:TextEditSettings MaskType="Numeric" Mask="c0" MaskUseAsDisplayFormat="True" MaskCulture="Vietnamese (Vietnam)"/>
                        </dxg:GridColumn.EditSettings>
                    </dxg:GridColumn>
                    <dxg:GridColumn Header="Số hóa đơn" FieldName="PhieuNhapThuoc.SoHoaDon" AllowEditing="False" Width="60"/>
                    <dxg:GridColumn Header="Lý do" FieldName="LyDo" AllowEditing="False" Width="80"/>
                    <dxg:GridColumn Header="Ngày trả" FieldName="NgayTra" AllowEditing="False" Width="60">
                        <dxg:GridColumn.EditSettings>
                            <dxe:DateEditSettings MaskType="DateTimeAdvancingCaret" DisplayFormat="dd/MM/yyyy"/>
                        </dxg:GridColumn.EditSettings>
                    </dxg:GridColumn>
                    
                </dxg:GridControl.Columns>
                <dxg:GridControl.TotalSummary>
                    <dxg:GridSummaryItem FieldName="TenNhaPhanPhoi" SummaryType="Count" DisplayFormat=" {0:n0} dòng"/>
                    <dxg:GridSummaryItem FieldName="SoTien" SummaryType="Sum" DisplayFormat=" {0:n0} đ"/>
                </dxg:GridControl.TotalSummary>
                <dxg:GridControl.View>
                    <dxg:TableView Name="tbvPhieu" ShowAutoFilterRow="True"
                                    MultiSelectMode="None" AutoWidth="True"
                                    IsRowCellMenuEnabled="True" NavigationStyle="Row"
                                    ShowTotalSummary="True"
                                    ShowGroupedColumns="False" ShowColumnHeaders="True"  
                                    MaxHeight="1800" Margin="2 2 2 2"
                                    ShowGroupPanel="False" AllowEditing="False" 
                                    AllowDrop="False" AllowGrouping="False" AllowMoveColumnToDropArea="False" 
                                    AllowMoving="False" IsColumnMenuEnabled="False" IsDeferredScrolling="False" 
                                    IsGroupPanelMenuEnabled="False"
                                    IsTotalSummaryMenuEnabled="False">
                    </dxg:TableView>
                </dxg:GridControl.View>
            </dxg:GridControl>
        </Grid>
    </Grid>
</UserControl>
